package com.cxs.plan.utils;

import com.cxs.plan.domain.PageResult;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;

import java.util.List;


@Component
public class PageUtil {

    public PageResult autoPage(List<?> list) {
        PageInfo<?> pageInfo = new PageInfo<>(list);
        PageResult result = new PageResult();
        BeanUtils.copyProperties(pageInfo, result);
        return result;
    }
}
